package com.epcs.model.dto;
// Generated 11:42:59 01-02-2014 by Hibernate Tools 3.2.1.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

/**
 * Following generated by hbm2java
 */
@Entity
@Table(name = "following", catalog = "epcs")
public class Following implements java.io.Serializable {

    private Integer followingId;
    private Account account;
    private Integer idOfFollow;
    private String typeOfFollow;
    private Set<Notification> notifications = new HashSet<Notification>(0);

    public Following() {
    }

    public Following(Account account, Integer idOfFollow, String typeOfFollow) {
        this.account = account;
        this.idOfFollow = idOfFollow;
        this.typeOfFollow = typeOfFollow;
    }

    public Following(Account account, Integer idOfFollow, String typeOfFollow, Set<Notification> notifications) {
        this.account = account;
        this.idOfFollow = idOfFollow;
        this.typeOfFollow = typeOfFollow;
        this.notifications = notifications;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "followingID", unique = true, nullable = false)
    public Integer getFollowingId() {
        return this.followingId;
    }

    public void setFollowingId(Integer followingId) {
        this.followingId = followingId;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "username", nullable = false)
    public Account getAccount() {
        return this.account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    @Column(name = "idOfFollow", nullable = false)
    public Integer getIdOfFollow() {
        return this.idOfFollow;
    }

    public void setIdOfFollow(Integer idOfFollow) {
        this.idOfFollow = idOfFollow;
    }

    @Column(name = "typeOfFollow", nullable = false, length = 9)
    public String getTypeOfFollow() {
        return this.typeOfFollow;
    }

    public void setTypeOfFollow(String typeOfFollow) {
        this.typeOfFollow = typeOfFollow;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "following")
    public Set<Notification> getNotifications() {
        return this.notifications;
    }

    public void setNotifications(Set<Notification> notifications) {
        this.notifications = notifications;
    }
}
